﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RLGDashboard
{
    public class RangeContainer
    {
        public Range[] egt1Container;
        public Range[] egt2Container;
        public Range[] egt3Container;
        public Range[] egt4Container;
        public Range[] psi1Container;
        public Range[] psi2Container;
        public Range[] psi3Container;
        public Range[] rpm1Container;
        public Range[] rpm2Container;
        public Range[] rpm3Container;
        public Range[] voltageContainer;
        public Range[] afrContainer;
        
        public RangeContainer()
        {
            egt1Container = new Range[] { new Range(0, 1000, "Green"), new Range(1001, 1200, "Red") };
            egt2Container = new Range[] { new Range(0, 1000, "Green"), new Range(1001, 1200, "Red") };
            egt3Container = new Range[] { new Range(0, 1000, "Green"), new Range(1001, 1200, "Red") };
            egt4Container = new Range[] { new Range(0, 1000, "Green"), new Range(1001, 1200, "Red") };
            psi1Container = new Range[] { new Range(-100, 0, "Green"), new Range(1, 100, "Red") };
            psi2Container = new Range[] { new Range(-100, 0, "Green"), new Range(1, 100, "Red") };
            psi3Container = new Range[] { new Range(-100, 0, "Green"), new Range(1, 100, "Red") };
            rpm1Container = new Range[] { new Range(0, 5000, "Green"), new Range(5001, 6000, "Red") };
            rpm2Container = new Range[] { new Range(0, 5000, "Green"), new Range(5001, 6000, "Red") };
            rpm3Container = new Range[] { new Range(0, 5000, "Green"), new Range(5001, 6000, "Red") };
            voltageContainer = new Range[] { new Range(-5, 0, "Green"), new Range(1, 5, "Red") };
            afrContainer = new Range[] { new Range(0, 30, "Green"), new Range(31, 45, "Red") };
        }

        public void addEGT1Range(Int32 inMin, Int32 inMax, String inColor)
        {
            Range newRange = new Range(inMin, inMax, inColor);
            this.egt1Container = ArrayExtension.addItemToArray(this.egt1Container, newRange);
        }

        public void removeEGT1Range(Int32 removalIndex)
        {
            this.egt1Container = ArrayExtension.removeItemFromArray(this.egt1Container, removalIndex);
        }

        public void addEGT2Range(Int32 inMin, Int32 inMax, String inColor)
        {
            Range newRange = new Range(inMin, inMax, inColor);
            this.egt2Container = ArrayExtension.addItemToArray(this.egt2Container, newRange);
        }

        public void removeEGT2Range(Int32 removalIndex)
        {
            this.egt2Container = ArrayExtension.removeItemFromArray(this.egt2Container, removalIndex);
        }

        public void addEGT3Range(Int32 inMin, Int32 inMax, String inColor)
        {
            Range newRange = new Range(inMin, inMax, inColor);
            this.egt3Container = ArrayExtension.addItemToArray(this.egt3Container, newRange);
        }

        public void removeEGT3Range(Int32 removalIndex)
        {
            this.egt3Container = ArrayExtension.removeItemFromArray(this.egt3Container, removalIndex);
        }

        public void addEGT4Range(Int32 inMin, Int32 inMax, String inColor)
        {
            Range newRange = new Range(inMin, inMax, inColor);
            this.egt4Container = ArrayExtension.addItemToArray(this.egt4Container, newRange);
        }

        public void removeEGT4Range(Int32 removalIndex)
        {
            this.egt4Container = ArrayExtension.removeItemFromArray(this.egt4Container, removalIndex);
        }

        public void addRPM1Range(Int32 inMin, Int32 inMax, String inColor)
        {
            Range newRange = new Range(inMin, inMax, inColor);
            this.rpm1Container = ArrayExtension.addItemToArray(this.rpm1Container, newRange);
        }

        public void removeRPM1Range(Int32 removalIndex)
        {
            this.rpm1Container = ArrayExtension.removeItemFromArray(this.rpm1Container, removalIndex);
        }

        public void addRPM2Range(Int32 inMin, Int32 inMax, String inColor)
        {
            Range newRange = new Range(inMin, inMax, inColor);
            this.rpm2Container = ArrayExtension.addItemToArray(this.rpm2Container, newRange);
        }

        public void removeRPM2Range(Int32 removalIndex)
        {
            this.rpm2Container = ArrayExtension.removeItemFromArray(this.rpm2Container, removalIndex);
        }

        public void addRPM3Range(Int32 inMin, Int32 inMax, String inColor)
        {
            Range newRange = new Range(inMin, inMax, inColor);
            this.rpm3Container = ArrayExtension.addItemToArray(this.rpm3Container, newRange);
        }

        public void removeRPM3Range(Int32 removalIndex)
        {
            this.rpm3Container = ArrayExtension.removeItemFromArray(this.rpm3Container, removalIndex);
        }

        public void addPSI1Range(Int32 inMin, Int32 inMax, String inColor)
        {
            Range newRange = new Range(inMin, inMax, inColor);
            this.psi1Container = ArrayExtension.addItemToArray(this.psi1Container, newRange);
        }

        public void removePSI1Range(Int32 removalIndex)
        {
            this.psi1Container = ArrayExtension.removeItemFromArray(this.psi1Container, removalIndex);
        }

        public void addPSI2Range(Int32 inMin, Int32 inMax, String inColor)
        {
            Range newRange = new Range(inMin, inMax, inColor);
            this.psi2Container = ArrayExtension.addItemToArray(this.psi2Container, newRange);
        }

        public void removePSI2Range(Int32 removalIndex)
        {
            this.psi2Container = ArrayExtension.removeItemFromArray(this.psi2Container, removalIndex);
        }

        public void addPSI3Range(Int32 inMin, Int32 inMax, String inColor)
        {
            Range newRange = new Range(inMin, inMax, inColor);
            this.psi3Container = ArrayExtension.addItemToArray(this.psi3Container, newRange);
        }

        public void removePSI3Range(Int32 removalIndex)
        {
            this.psi3Container = ArrayExtension.removeItemFromArray(this.psi3Container, removalIndex);
        }

        public void addAFRRange(Int32 inMin, Int32 inMax, String inColor)
        {
            Range newRange = new Range(inMin, inMax, inColor);
            this.afrContainer = ArrayExtension.addItemToArray(this.afrContainer, newRange);
        }

        public void removeAFRRange(Int32 removalIndex)
        {
            this.afrContainer = ArrayExtension.removeItemFromArray(this.afrContainer, removalIndex);
        }

        public void addVoltageRange(Int32 inMin, Int32 inMax, String inColor)
        {
            Range newRange = new Range(inMin, inMax, inColor);
            this.voltageContainer = ArrayExtension.addItemToArray(this.voltageContainer, newRange);
        }

        public void removeVoltageRange(Int32 removalIndex)
        {
            this.voltageContainer = ArrayExtension.removeItemFromArray(this.voltageContainer, removalIndex);
        }


    }
}
